<?php $this->headScript()->appendFile($this->JS_PATH . "enoria.js"); ?>
<div id="enoria-listing"></div>
<div class="content">
    <div class="page-title"> <i class="icon-custom-right"></i>
        <h3><span class="semi-bold">Add Enoria</span></h3>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="grid simple">
                <div class="grid-title">
                </div>
                <div class="grid-body ">
                    <div class="row">


                        <?php if (count($this->errorMessageArray) > 0): ?>
                            <div class="alert alert-error">
                                <?php foreach ($this->errorMessageArray as $erroValue): ?>

                                    <div class="text-left">
                                        <i class="icon-remove-sign"></i>
                                        <?php echo $erroValue; ?>
                                    </div>

                                <?php endforeach; ?>
                            </div>
                        <?php endif; ?>

                        <form role="form"  id="enoria-form" name="enoria-form"  enctype="multipart/form-data"  action="" method="post">
                            <div class="row form-row display-none">
                                <div class="col-md-6">
                                    <label class="form-label">Identity Code</label>
                                    <input type="text" placeholder="Identity Code" class="form-control" value="<?php echo $this->languages[1]['en_identity_code']; ?>" id="en_identity_code" name="en_identity_code">
                                </div>
                            </div> 

                            <div class="row form-row display-none">
                                <div class="col-md-6">
                                    <label class="form-label">Name</label>
                                    <input type="text" placeholder="Name" class="form-control" value="<?php echo $this->languages[1]['en_name']; ?>" id="en_name" name="en_name">
                                </div>
                            </div> 
                            <div class="row form-row">
                                <div class="col-md-6">
                                    <label class="form-label">Area</label>
                                    <select placeholder="" class="form-control " id="area_id" name="area_id" >
                                        <?php
                                        foreach ($this->areaArray as $_key => $_value):
                                            if ($this->languages[1]['area_id'] == $_key):
                                                $selected = "selected";
                                            else:
                                                $selected = "";
                                            endif;
                                            ?>
                                            <option <?php echo $selected; ?> value="<?php echo $_key; ?>"><?php echo $_value; ?></option>
<?php endforeach; ?>
                                    </select>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <ul class="nav nav-pills" id="tab-4">
                                        <?php
                                        $counterln = 1;
                                        foreach ($this->languages as $_lan):
                                            ?>
                                            <li <?php if ($counterln == 1) echo 'class="active"'; ?> ><a href="#tabs<?php echo ucfirst($_lan['lang_name']); ?>"><?php echo ucfirst($_lan['lang_name']); ?> Description</a></li>
    <?php $counterln++; ?> 
                                        <?php endforeach; ?>
                                    </ul>
                                    <div class="tab-content">
                                        <?php
                                        $counterln = 1;
                                        foreach ($this->languages as $_lan):
                                            ?>
                                            <div class="tab-pane <?php if ($counterln == 1) echo 'active'; ?> " id="tabs<?php echo ucfirst($_lan['lang_name']); ?>">


                                                <div class="row form-row">
                                                    <div class="col-md-6">
                                                        <label class="form-label">Title</label>
                                                        <input type="text" placeholder="Title" class="form-control" value="<?php echo $_lan['en_title']; ?>" id="en_title" name="<?php echo $_lan['lang_id']; ?>_en_title">
                                                    </div>
                                                </div> 

                                            </div>
                                            <?php $counterln++; ?> 
<?php endforeach; ?>
                                    </div>
                                </div>
                            </div>

                            <div class="row form-row">
                                <div class="col-md-6">
                                    <?php if ($this->mode == 'Edit'): ?>
                                        <input type="submit" value="Update" class="submitfrmbtn btn btn-primary" name="Update"/>
                                    <?php else: ?>
                                        <input type="submit" value="Submit" class="submitfrmbtn   btn btn-primary" name="Submit"/>
<?php endif; ?>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- END PAGE -->                
